﻿// *----------------------------------------------------------------
// Copyright (C) 2017 通通优品
// 版权所有。
// 
// 类名：IDbContextProvider.cs
// 功能描述：TongTongMall.Dapper
// 
// Create User：jym 2017/02/09
// 
// Edit User：UserName,EditTime
// Describe：Describe
// ----------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TongTongMall.Dapper.DapperExtensions;
using TongTongMall.Dependecy;

namespace TongTongMall.Dapper
{
    public interface IDbContextProvider<out TDbContext> : ITransientDependency
          where TDbContext : IDatabase
    {
        /// <summary>
        /// 获取DbContext实例
        /// </summary>
        /// <returns></returns>
        TDbContext GetDbContext();

        ///// <summary>
        ///// 获取一个数据连接对象
        ///// </summary>
        ///// <returns></returns>
        //IDbConnection GetCurrentConnection { get; }

        ///// <summary>
        ///// 获取当前活跃的connectionlist集合，包含多个数据库
        ///// </summary>
        ///// <returns></returns>
        //string GetCurrentConnectionListKeys();

        ///// <summary>
        ///// 释放本次连接对象内多有的数据库连接对象
        ///// </summary>
        //void DisposedConnections();
    }
}
